<?php

namespace app\system\controller;

use app\system\model\NoticeModel;
use app\system\model\PostModel;
use think\App;

class Notice extends Base
{

    private $noticeModel;

    public function __construct(App $app)
    {
        parent::__construct($app);
        $this->noticeModel = new NoticeModel();
    }

    /**
     * 获取通知公告列表
     */
    public function list()
    {
        $param = $this->request->param();
        $info = $this->noticeModel->paginate([
            'page'=>$param['pageNum'],
            'list_row'=>$param['pageSize']
        ])->toArray();

        $returnData = [
            'code'=> 200,
            'msg'=> '操作成功',
            'rows'=> $info['data'],
            'total'=> $info['total']
        ];
        return json($returnData);
    }

    /**
     * 根据通知公告编号获取详细信息
     */
    public function getInfo()
    {

    }

    /**
     * 新增通知公告
     */
    public function add()
    {

    }

    /**
     * 修改通知公告
     */
    public function edit()
    {

    }

    /**
     * 删除通知公告
     */
    public function remove()
    {

    }
}